package com.yztstudy.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * 订单对应的实体类
 */

@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "orders")
@JsonIgnoreProperties(ignoreUnknown = true)
public class Order implements Serializable {

    public static final Long serialVersionUID = 1L;

    // 成员变量
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id; // 主键

    @TableField(value = "order_id")
    @JsonProperty("order_id")
    private Long orderId; // 订单主键

    @TableField(value = "user_id")
    @JsonProperty("user_id")
    private Integer userId; // 用户主键

    @TableField(value = "product_id")
    @JsonProperty("product_id")
    private Integer productId; // 商品主键

    @TableField(value = "product_num")
    @JsonProperty("product_num")
    private Integer productNum; // 商品数量

    @TableField(value = "product_price")
    @JsonProperty("product_price")
    private Double productPrice; // 商品价格


    @TableField(value = "order_time")
    @JsonProperty("order_time")
    private Long orderTime; // 下单时间
}
